//
//  MNDDiscountReguraViewController.m
//  minidai
//
//  Created by 谭谭伟 on 17/5/13.
//  Copyright © 2017年 迷你金服. All rights reserved.
//

#import "MNDAlertDiscountReguraViewController.h"

@interface MNDAlertDiscountReguraViewController ()


@end

@implementation MNDAlertDiscountReguraViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(popviewController:)]];
    // Do any additional setup after loading the view.
    self.alertContainView.transform = CGAffineTransformMakeScale(0.2, 0.2);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [UIView animateWithDuration:0.7
                          delay:0.0
         usingSpringWithDamping:0.5
          initialSpringVelocity:0.1
                        options:UIViewAnimationOptionCurveEaseIn
                     animations:^{
                         
                         self.alertContainView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.0, 1.0);
                     }
                     completion:^(BOOL finished) {
                         
                     }];

}

- (void)popviewController:(UITapGestureRecognizer *)gesture {
    [UIView animateWithDuration:0.5 animations:^{
        self.alertContainView.frame = CGRectMake(self.alertContainView.frame.origin.x, kScreenHeight, self.alertContainView.frame.size.width, self.alertContainView.frame.size.height);
    } completion:^(BOOL finished) {
        [self.view removeFromSuperview];
        [self removeFromParentViewController];
        [self.navigationController popViewControllerAnimated:YES];
    }];
   
}
@end
